<?php

require_once 'init.php';

$page = cf\api\page\get( cf\param::get('id') );

$currTopPage = $page['branch'][1];

$smarty->assign('page',$page);
$smarty->assign('pageText',cf\api\page\getText($page['id']));

$path = str_replace('ru/','',$page['path']);
$subMenu = cf\api\page\getTree($page['id'],false,1,$path);
if (empty($subMenu) && $page['depth']==3) {
	$path = str_replace('ru/','',$page['parent']['path']);
	$subMenu = cf\api\page\getTree($page['parent_id'],false,1,$path);
}
$smarty->assign('subMenu',$subMenu);

$smarty->assign('icon',$page['icon'] ? $page['icon'] : $page['parent']['icon']);

show(
	'page', 
	$page['name'], 
	array(), 
	$page['title'], 
	$page['keywords'], 
	$page['descr']
);
?>